import request from '@/utils/request'

// 查询隐患风险排查计划列表
export function listPlan(query) {
  return request({
    url: '/exclude/plan/list',
    method: 'get',
    params: query
  })
}

// 查询隐患风险排查计划详细
export function getPlan(id) {
  return request({
    url: '/exclude/plan/' + id,
    method: 'get'
  })
}

// 新增隐患风险排查计划
export function addPlan(data) {
  return request({
    url: '/exclude/plan',
    method: 'post',
    data: data
  })
}

// 修改隐患风险排查计划
export function updatePlan(data) {
  return request({
    url: '/exclude/plan',
    method: 'put',
    data: data
  })
}

// 删除隐患风险排查计划
export function delPlan(id) {
  return request({
    url: '/exclude/plan/' + id,
    method: 'delete'
  })
}

// 排查范围树
export function getTree(query) {
  return request({
    url: '/duty/region/region/tree',
    method: 'get',
    params: query
  })
}


//批量修改
export function updatePlanBatch(data) {
  return request({
    url: '/exclude/plan/update/batch',
    method: 'put',
    data: data
  })
}

export function getPlanSelect() {
  return request({
    url: '/common/type/gettype',
    method: 'get'
  })
}

//取消/批量取消
export function getPlanSelectCancel(data) {
  return request({
    url: '/plan/task/cancel',
    method: 'put',
    params:data
  })
}

//生成/批量生成
export function getPlanSelectCancelOver(data) {
  return request({
    url: '/plan/task/add',
    method: 'get',
    params:data
  })
}